<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>Firmware for Arduino | PLEN Project Company Inc.: ExternalEEPROM.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Firmware for Arduino | PLEN Project Company Inc.
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_external_e_e_p_r_o_m_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ExternalEEPROM.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_external_e_e_p_r_o_m_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef PLEN2_EXTERNAL_EEPROM_H</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="_external_e_e_p_r_o_m_8h.html#abcb330bf53cae3084198d51e0f95104a">   11</a></span>&#160;<span class="preprocessor">#define PLEN2_EXTERNAL_EEPROM_H</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_p_l_e_n2.html">PLEN2</a></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;{</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    <span class="keyword">class </span>ExternalEEPROM;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;}</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html">   32</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html">PLEN2::ExternalEEPROM</a></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;{</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="keyword">enum</span> { CLOCK = 400000UL };</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="keyword">enum</span> { SIZE = 0x20000UL };</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keyword">enum</span> { ADDRESS = 0x50 };</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="keyword">enum</span> { ADDRESS_BYTES = 2 };</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keyword">enum</span> { SELECT_BIT = 2 };</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a8aebdbedd670c2ae9b83c5efb0f316eaa3b6c8317e8268a5fb896923c4a8433d2">   52</a></span>&#160;    <span class="keyword">enum</span> { <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a8aebdbedd670c2ae9b83c5efb0f316eaa3b6c8317e8268a5fb896923c4a8433d2">CHUNK_SIZE</a> = 32 };</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a384e612e5373158f853e5e7efb2dc679aa893a7791ec868480f4576b02e8a3c98">   55</a></span>&#160;    <span class="keyword">enum</span> { <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a384e612e5373158f853e5e7efb2dc679aa893a7791ec868480f4576b02e8a3c98">SLOT_SIZE</a> = <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a8aebdbedd670c2ae9b83c5efb0f316eaa3b6c8317e8268a5fb896923c4a8433d2">CHUNK_SIZE</a> - ADDRESS_BYTES };</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a1d9154051d9835a3a062605770ebbac2a6391779cbbc4ba84b717ccfbd6a00fd4">   58</a></span>&#160;    <span class="keyword">enum</span> { <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a1d9154051d9835a3a062605770ebbac2a6391779cbbc4ba84b717ccfbd6a00fd4">SLOT_BEGIN</a> = 0 };</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#adf55bead9b5cbfa994d855a89b61fc0faada4fde0f7a073c7708de50f32336a33">   61</a></span>&#160;    <span class="keyword">enum</span> { <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#adf55bead9b5cbfa994d855a89b61fc0faada4fde0f7a073c7708de50f32336a33">SLOT_END</a> = SIZE / <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a8aebdbedd670c2ae9b83c5efb0f316eaa3b6c8317e8268a5fb896923c4a8433d2">CHUNK_SIZE</a> };</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a6de9ba73e5c1c5e68eeca23939cd19f0">   66</a></span>&#160;    <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a6de9ba73e5c1c5e68eeca23939cd19f0">ExternalEEPROM</a>() { <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#ab2fbe055be630b7a150120a1b0d78741">begin</a>(); }</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#ab2fbe055be630b7a150120a1b0d78741">begin</a>();</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keyword">static</span> int8_t <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#aa427fcc2ddee1e2defc5d010f8277201">readSlot</a>(uint16_t slot, uint8_t data[], uint8_t read_size);</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">static</span> int8_t <a class="code" href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a99d218ed84e338400dbd857b2c95a9bc">writeSlot</a>(uint16_t slot, <span class="keyword">const</span> uint8_t data[], uint8_t write_size);</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;};</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="preprocessor">#endif // PLEN2_EXTERNAL_EEPROM_H</span></div>
<div class="ttc" id="namespace_p_l_e_n2_html"><div class="ttname"><a href="namespace_p_l_e_n2.html">PLEN2</a></div><div class="ttdef"><b>Definition:</b> AccelerationGyroSensor.h:16</div></div>
<div class="ttc" id="class_p_l_e_n2_1_1_external_e_e_p_r_o_m_html_aa427fcc2ddee1e2defc5d010f8277201"><div class="ttname"><a href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#aa427fcc2ddee1e2defc5d010f8277201">PLEN2::ExternalEEPROM::readSlot</a></div><div class="ttdeci">static int8_t readSlot(uint16_t slot, uint8_t data[], uint8_t read_size)</div><div class="ttdoc">Read a slot of external EEPROM. </div></div>
<div class="ttc" id="class_p_l_e_n2_1_1_external_e_e_p_r_o_m_html_adf55bead9b5cbfa994d855a89b61fc0faada4fde0f7a073c7708de50f32336a33"><div class="ttname"><a href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#adf55bead9b5cbfa994d855a89b61fc0faada4fde0f7a073c7708de50f32336a33">PLEN2::ExternalEEPROM::SLOT_END</a></div><div class="ttdef"><b>Definition:</b> ExternalEEPROM.h:61</div></div>
<div class="ttc" id="class_p_l_e_n2_1_1_external_e_e_p_r_o_m_html"><div class="ttname"><a href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html">PLEN2::ExternalEEPROM</a></div><div class="ttdoc">Management class of external EEPROM. </div><div class="ttdef"><b>Definition:</b> ExternalEEPROM.h:32</div></div>
<div class="ttc" id="class_p_l_e_n2_1_1_external_e_e_p_r_o_m_html_a384e612e5373158f853e5e7efb2dc679aa893a7791ec868480f4576b02e8a3c98"><div class="ttname"><a href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a384e612e5373158f853e5e7efb2dc679aa893a7791ec868480f4576b02e8a3c98">PLEN2::ExternalEEPROM::SLOT_SIZE</a></div><div class="ttdef"><b>Definition:</b> ExternalEEPROM.h:55</div></div>
<div class="ttc" id="class_p_l_e_n2_1_1_external_e_e_p_r_o_m_html_a99d218ed84e338400dbd857b2c95a9bc"><div class="ttname"><a href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a99d218ed84e338400dbd857b2c95a9bc">PLEN2::ExternalEEPROM::writeSlot</a></div><div class="ttdeci">static int8_t writeSlot(uint16_t slot, const uint8_t data[], uint8_t write_size)</div><div class="ttdoc">Write a slot of external EEPROM. </div></div>
<div class="ttc" id="class_p_l_e_n2_1_1_external_e_e_p_r_o_m_html_a1d9154051d9835a3a062605770ebbac2a6391779cbbc4ba84b717ccfbd6a00fd4"><div class="ttname"><a href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a1d9154051d9835a3a062605770ebbac2a6391779cbbc4ba84b717ccfbd6a00fd4">PLEN2::ExternalEEPROM::SLOT_BEGIN</a></div><div class="ttdef"><b>Definition:</b> ExternalEEPROM.h:58</div></div>
<div class="ttc" id="class_p_l_e_n2_1_1_external_e_e_p_r_o_m_html_a6de9ba73e5c1c5e68eeca23939cd19f0"><div class="ttname"><a href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a6de9ba73e5c1c5e68eeca23939cd19f0">PLEN2::ExternalEEPROM::ExternalEEPROM</a></div><div class="ttdeci">ExternalEEPROM()</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> ExternalEEPROM.h:66</div></div>
<div class="ttc" id="class_p_l_e_n2_1_1_external_e_e_p_r_o_m_html_ab2fbe055be630b7a150120a1b0d78741"><div class="ttname"><a href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#ab2fbe055be630b7a150120a1b0d78741">PLEN2::ExternalEEPROM::begin</a></div><div class="ttdeci">static void begin()</div><div class="ttdoc">Static constructor. </div></div>
<div class="ttc" id="class_p_l_e_n2_1_1_external_e_e_p_r_o_m_html_a8aebdbedd670c2ae9b83c5efb0f316eaa3b6c8317e8268a5fb896923c4a8433d2"><div class="ttname"><a href="class_p_l_e_n2_1_1_external_e_e_p_r_o_m.html#a8aebdbedd670c2ae9b83c5efb0f316eaa3b6c8317e8268a5fb896923c4a8433d2">PLEN2::ExternalEEPROM::CHUNK_SIZE</a></div><div class="ttdef"><b>Definition:</b> ExternalEEPROM.h:52</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="_external_e_e_p_r_o_m_8h.html">ExternalEEPROM.h</a></li>
    <li class="footer">Generated on Tue Oct 11 2016 13:20:21 for Firmware for Arduino | PLEN Project Company Inc. by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
